from pyson.json_encoding.base import _register_builtin, attr_fields, callfunc
from datetime import date, datetime

_register_builtin(date, 'date',
    encoder=attr_fields(u'year month day'.split()),
    decoder=callfunc(date))

_register_builtin(datetime, 'datetime',
    encoder=attr_fields(u'year month day hour minute second microsecond'.split()),
    decoder=callfunc(datetime))
